#ifndef BCDIDO_THREAD_H
#define BCDIDO_THREAD_H
#include <QThread>
#include <QDateTime>
#include "KgGlobalData.h"

class CBattStack;
//#define WTGZ_PRJ // 威腾广州【002003476】BA10-V2.0.0

// added 2024-11-20 // 处理BC的DI,DO,有延时处理,需要单独开一个线程
// 【002003357】安徽昆宇河北英利项目 先跳汇流开关，再脱扣BC的DOB
class BcDiDoThread : public QThread
{
	Q_OBJECT
public:	
	BcDiDoThread(QObject *parent);
	~BcDiDoThread();
public:
	void run();
private:
	void dealwithBCDIState(CBattStack *pStack);
	void dealwithBCDOState();
	int  getBCDIValue(CBattBank *pBank, int diIndex);
	void waitConfSwitchBreaked();
private:
    char m_bcDiOldState[30][50];
	char m_bcResDiOldState[30][10];
	int  m_printCount;
	int  m_bcDoLogCount;
	int  m_runCount;

	int m_oldCtrlFanState[30];
	int m_closeFanReqCount[30];
	QDateTime m_closeReqStartTime[30];
};

#endif // BCDIDO_THREAD_H